#!/bin/bash
mkdir -p ../转移后/

i=0


while IFS= read -d '' filename; do
let i+=1
name=`printf "%06d\n" $i`
ln -sv "${filename}"  "../转移后/${name}_`basename "${filename}"`"
 
done < <(find "`pwd`" -name "*.png" -type f -print0)

while IFS= read -d '' filename; do
let i+=1
name=`printf "%06d\n" $i`
ln -sv "${filename}"  "../转移后/${name}_`basename "${filename}"`"
 
done < <(find "`pwd`" -name "*.jpg" -type f -print0)

while IFS= read -d '' filename; do
let i+=1
name=`printf "%06d\n" $i`
ln -sv "${filename}"  "../转移后/${name}_`basename "${filename}"`"
 
done < <(find "`pwd`" -name "*.jpeg" -type f -print0)

while IFS= read -d '' filename; do
let i+=1
name=`printf "%06d\n" $i`
ln -sv "${filename}"  "../转移后/${name}_`basename "${filename}"`"
 
done < <(find "`pwd`" -name "*.pdf" -type f -print0)

while IFS= read -d '' filename; do
let i+=1
name=`printf "%06d\n" $i`
ln -sv "${filename}"  "../转移后/${name}_`basename "${filename}"`"
 
done < <(find "`pwd`" -name "*.gif" -type f -print0)


mv ../转移后 .
